﻿using System.Windows;
using System.Windows.Media;

namespace Gmantis.Controls.Chart
{
    public class PolarRadarOptions : DependencyObject
    {
        // Fields
        public static DependencyProperty DirectionProperty = Utils.RegisterAttachedProperty("Direction", typeof(SweepDirection), typeof(PolarRadarOptions), new PropertyChangedCallback(Chart.OnAttachedPropertyChanged), SweepDirection.Clockwise);
        public static DependencyProperty StartingAngleProperty = Utils.RegisterAttachedProperty("StartingAngle", typeof(double), typeof(PolarRadarOptions), new PropertyChangedCallback(Chart.OnAttachedPropertyChanged), 0.0);

        // Methods
        [AttachedPropertyBrowsableForType(typeof(Chart))]
        public static SweepDirection GetDirection(Chart chart)
        {
            return (SweepDirection)chart.GetValue(DirectionProperty);
        }

        [AttachedPropertyBrowsableForType(typeof(Chart))]
        public static double GetStartingAngle(Chart chart)
        {
            return (double)chart.GetValue(StartingAngleProperty);
        }

        internal static void Reset(Chart chart)
        {
            chart.ClearValue(StartingAngleProperty);
            chart.ClearValue(DirectionProperty);
        }

        public static void SetDirection(Chart chart, SweepDirection value)
        {
            chart.SetValue(DirectionProperty, value);
        }

        public static void SetStartingAngle(Chart chart, double value)
        {
            chart.SetValue(StartingAngleProperty, value);
        }
    }
}
